<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{$is_language?'註冊':'Register'}</title>
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <link rel="stylesheet" href="__MODULE_LIBS__/css/weui.min.css">
    <link rel="stylesheet" href="__MODULE_LIBS__/css/jquery-weui.css">
    <link rel="stylesheet" href="__MODULE_LIBS__/css/demos.css">
    <script src="__MODULE_LIBS__/js/jquery-2.1.4.js"></script>
    <script src="__MODULE_LIBS__/js/fastclick.js"></script>
    <script src="__MODULE_LIBS__/js/jquery-weui.js"></script>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        html{
            width: 100%;
            height: 100%;
            font-size: 20px;
            font-family: "Microsoft YaHei", "宋体", "Segoe UI", "Lucida Grande", Helvetica, Arial, sans-serif, FreeSans, Arimo;
            background: #F3F3F3;
        }
        body{
            position: relative;
            margin: 0 auto;
            max-width: 750px;
            font-size: 0.8rem;
            background: url('http://cdn.mogo.club/f775d4db751d138b0bd7d03876f4d917.png');
            background-size: 100% 100%;
            background-attachment:fixed;
        }
        .navbar{
            position: relative;
            width: 100%;
            height: 2rem;
            font-size: 16px;
            color: #fff;
            line-height: 2rem;
            background: #373553;
        }
        .navbar-item{
            position: absolute;
            left: 0;
            top:0;
            display: block;
            width: 4.0rem;
            height: 2rem;
            font-size: 14px;
            color: #fff;
            text-align: center;
        }
        .navbar-item>img{
            width: 0.8rem;
            height: 0.7rem;
            vertical-align: middle;
        }
        .navbar-center{
            text-align: center;
        }
        .content{
            width: 100%;
        }
        .alading{
            padding-top: 4rem;
            font-size: 1rem;
            color: #ffffff;
            text-align: center;
        }
        .registerForm{
            padding-top: 2rem;
        }
        .weui-cells{
            position: relative;
            margin-left: auto;
            margin-right: auto;
            margin-top: 0rem;
            width: 94%;
            font-size: 0.8rem;
            background-color: transparent;
            border-radius: 0.3rem;
        }
        .weui-cells:before{
            border-top: none;
        }
        .weui-cells:after {
            border-bottom: 1px solid #fff;
        }
        .weui-cell{
            padding: 0.6rem 0.4rem;
        }
        .weui-label{
            width: 2.4rem;
        }
        .weui-label>img{
            width: 1.0rem;
        }
        input::placeholder{
            font-size: 0.7rem;
            color: #e5e5e5;
        }
        /*谷歌的兼容写法*/
        input::-webkit-input-placeholder{
            font-size: 0.7rem;
            color: #e5e5e5;
        }
        /*火狐的兼容写法*/
        input::-moz-placeholder{
            font-size: 0.7rem;
            color: #e5e5e5;
        }
        .weui-input{
            color: rgba(255,255,255,1);
        }
        .rg-btn{
            margin-top:2rem;
            background: #fff;
        }
        .btn{
            width: 100%;
            font-size: 0.8rem;
            color: #000000;
            border: 0;
            outline: 0;
            -webkit-appearance: none;
            background-color: transparent;
        }
    </style>
</head>
<body>
<header class="navbar">
    <a href="{:url('index')}" class="navbar-item">
       <img src="__MODULE_LIBS__/img/back.png" />&nbsp;{$is_language?'返回':'Return'}
    </a>
    <div class="navbar-center">{$is_language?'註冊':'Register'}</div>
    <div class="navbar-item1">
        <select name="" id="yy">
            <option value="1" {$is_language?'selected':''}>中文</option>
            <option value="0" {$is_language?'':'selected'}>English</option>
        </select>
    </div>
</header>
<div class="content">
    <p class="alading">{$is_language?'會員註冊':'Member Registration'}</p>
    <form action="" method="post" class="registerForm">
        <div class="weui-cells weui-cells_form">
            <div class="weui-cell">
                <div class="weui-cell__hd">
                    <label class="weui-label">
                        <img src="__MODULE_LIBS__/img/number.png">
                    </label>
                </div>
                <div class="weui-cell__bd">
                    <input class="weui-input" type="text" placeholder="{$is_language?'請輸入您的賬號':'Please enter your account number'}" name="username" id="number">
                </div>
            </div>
        </div>
        <div class="weui-cells weui-cells_form">
            <div class="weui-cell">
                <div class="weui-cell__hd">
                    <label class="weui-label">
                        <img src="__MODULE_LIBS__/img/pwd.png">
                    </label>
                </div>
                <div class="weui-cell__bd">
                    <input class="weui-input" type="password" placeholder="{$is_language?'請輸入您設置的密碼':'Please set your password'}" name="password1" id="pwd1">
                </div>
            </div>
        </div>
        <div class="weui-cells weui-cells_form">
            <div class="weui-cell">
                <div class="weui-cell__hd">
                    <label class="weui-label">
                        <img src="__MODULE_LIBS__/img/pwd.png">
                    </label>
                </div>
                <div class="weui-cell__bd">
                    <input class="weui-input" type="password" placeholder="{$is_language?'請確認您設置的密碼':'Please confirm your password'}" name="password1_new" id="pwd2">
                </div>
            </div>
        </div>
        <div class="weui-cells weui-cells_form">
            <div class="weui-cell">
                <div class="weui-cell__hd">
                    <label class="weui-label">
                        <img src="__MODULE_LIBS__/img/vode.png">
                    </label>
                </div>
                <div class="weui-cell__bd">
                    <input class="weui-input" type="text" placeholder="{$is_language?'請輸入邀請碼':'Please enter the invitation code'}" name="code" id="pwd">
                </div>
            </div>
        </div>
        <div class="weui-cells weui-cells_form rg-btn">
            <div class="weui-cell">
                <div class="weui-cell__bd">
                    <input class="btn" type="submit" value="{$is_language?'註&nbsp;冊':'Register'}">
                </div>
            </div>
        </div>
    </form>
</div>


<script type="text/javascript">
    $(function(){
        FastClick.attach(document.body);
    })
    $(document).on("change",'select#yy',function(){
        var yy = $(this).val();
        console.log(yy)
        var url = "{:url('base/is_language')}";
        $.post(url,{language:yy},function (res) {
            window.location.reload();
        })
    });
    //获取设备高度（软键盘调出来时高度也会变小，所以在点击事件前获取）
    var deviceH=document.documentElement.clientHeight+"px";
    //表单获得焦点后动态改变body和背景图片的大小
    $('.weui-input').bind("click",function(){
        $("body").attr("style",
            "background:url('http://cdn.mogo.club/f775d4db751d138b0bd7d03876f4d917.png') no-repeat;height:"+deviceH+";background-size: 100%"+deviceH);
    });
</script>

</body>
</html>
